<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jQuery事件对象</title>
    <script src="../jquery/jquery.v3.7.1.js"></script>
    <style>
        .box{
            width: 200px;
            height: 200px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div>
        <p>jQuery事件对象：</p>
        <p>事件被触发，就会有事件对象的产生。</p>
        <p>element.on(events,[selector],function(event){});</p>
        <p>阻止默认行为：event.preventDefualt() 或者 return false</p>
        <p>阻止冒泡：evet.stopPropagation()</p>
    </div>
    <div class="box"></div>
    <script>
        $(function(){
            $(document).on('click',function(){
                console.log('点击了 document');
            })
            $(window).on('click',function(){
                console.log('点击了 window');
            })
            $('.box').on('click',function(event){
                console.log('点击了box');
            })
        })
    </script>
</body>
</html>